package inline;

import com.ss.android.http.legacy.NameValue;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Iterator;
import java.util.List;

public class TextDemo {
    public static boolean c(String arg1) {
        return arg1 == null || arg1.length() == 0;
    }

    public static String a() {
        String hexTime = Long.toHexString(System.currentTimeMillis() / 1000);
        if (hexTime.length() != 8) {
            return  "7e0ac8874bb0985";
        } else {
            String v2 = com.bytedance.common.utility.aa.md5(hexTime);
            StringBuilder stringBuilder = new StringBuilder();
            for (int i = 0; i < 5; ++i) {
                stringBuilder.append(hexTime.charAt(i));
                stringBuilder.append(v2.charAt(i));
            }
            stringBuilder.append(hexTime.substring(5)).append("q1");
            return stringBuilder.toString();
        }
    }

    public static String a(List arg5, String arg6) {
        StringBuilder v1 = new StringBuilder();
        Iterator v2 = arg5.iterator();
        while (v2.hasNext()) {
            Object v0 = v2.next();
            String v3 = a(((NameValue) v0).name(), arg6);
            String v0_1 = ((NameValue) v0).value();
            v0_1 = v0_1 != null ? a(v0_1, arg6) : "";
            if (v1.length() > 0) {
                v1.append("&");
            }

            v1.append(v3);
            v1.append("=");
            v1.append(v0_1);
        }

        return v1.toString();
    }

    private static String a(String arg2, String arg3) {
        if (arg3 == null) {
            arg3 = "ISO-8859-1";

        }
        try {
            return URLEncoder.encode(arg2, arg3);
        } catch (UnsupportedEncodingException v0) {
            throw new IllegalArgumentException(((Throwable) v0));
        }
    }
}
